<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/2 0002
 * Time: 下午 12:10
 */

namespace app\admin\model;


use service\ToolsService;
use think\Model;

class CategoryModule extends Model
{

    public static function getindex(){
        $db = self::where(['status'=>1,'is_deleted'=>1])->order('sort asc,id asc')->select()->visible(['id','pid','name'])->toArray();
        $db = ToolsService::arr2tree($db);
        return $db;
    }

    public static function getmoindex(){
        $db = self::where(['status'=>1,'is_deleted'=>1,'pid'=>0])->order('sort asc,id asc')->select()->visible(['id','logo','name'])->toArray();
        return $db;
    }
}